public class MatrixGenerator {
    private static final int ROW_LOWER_LIMIT = 1400;
    private static final int ROW_UPPER_LIMIT = 1500;
    private static final double ELEMENT_UPPER_LIMIT = 100;
    private double[] [] matrix_M;//a*b
    private double[] [] matrix_N;//b*c

    /**生成a*b和b*c的矩阵
     *a、b、c的范围为 [ROW_LOWER_LIMIT,ROW_UPPER_LIMIT]
     * 元素 的范围是 [0,ELEMENT_UPPER_LIMIT)
     * */
    public void setRandomMatrix(){
        int a = ROW_LOWER_LIMIT+(int)(Math.random()*(ROW_UPPER_LIMIT-ROW_LOWER_LIMIT));
        int b = ROW_LOWER_LIMIT+(int)(Math.random()*(ROW_UPPER_LIMIT-ROW_LOWER_LIMIT));
        int c = ROW_LOWER_LIMIT+(int)(Math.random()*(ROW_UPPER_LIMIT-ROW_LOWER_LIMIT));
        System.out.println("a = "+a+" b= "+b+" c= "+c);
        matrix_M = new double[a][b];
        matrix_N = new double[b][c];

        for (int i = 0; i < a; i++) {
            for (int j = 0; j < b; j++) {
                matrix_M[i][j] = Math.random()*ELEMENT_UPPER_LIMIT;
            }
        }
        for (int i = 0; i < b; i++) {
            for (int j = 0; j < c; j++) {
                matrix_N[i][j] = Math.random()*ELEMENT_UPPER_LIMIT;
            }
        }
    }

    public double[][] getMatrix_M() {
        return matrix_M;
    }

    public double[][] getMatrix_N() {
        return matrix_N;
    }
}
